<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 应用场景1：已经有同事写出某个对象，但是对象属性过多
        let game = {
            gamename:'原神',
            play:()=>{
                console.log('玩游戏');
            }
        }
        let methods = {
            gamename:Symbol(),
            play:Symbol()
        }
        game[methods.gamename] = 'Genshin Impact'
        game[methods.play] = ()=>{
            console.log('玩原神');
        }

        // 应用场景2：自己写对象，但是属性名很多
        let school = {
            [Symbol("name")]:"ArimaMisaki",
            [Symbol("say")]:()=>{
                console.log("会说话");
            }
        }
    </script>
</body>
</html>